package com.xbfinal.staservice.controller;


import com.xbfinal.commonUtils.Result;
import com.xbfinal.staservice.client.UcenterClient;
import com.xbfinal.staservice.service.StatisticsDailyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author xbfinal
 * @since 2023-03-12
 */

@RestController
@RequestMapping("/staservice/sta")
public class StatisticsDailyController {


    @Autowired
    private StatisticsDailyService statService;


    @ApiOperation("统计某一天的注册人数")
    @PostMapping("registerCount/{day}")
    public Result registerCount(@PathVariable("day") String day){
        statService.registerCount(day);
        return  Result.ok();
    }



    @GetMapping("showData /{type}/{begin}/{end}")
    public Result showData(@PathVariable("type") String type,
                           @PathVariable("begin") String begin,
                           @PathVariable("end") String end){
        Map<String,Object> map =statService.getShowData(type,begin,end);

        return Result.ok().addData(map);
    }



}

